package lab02.test20;

import java.util.Scanner;

public class Test20 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入字符串:");
        String str = sc.nextLine();
        char[] ch = str.toCharArray();   //将字符串转换成字符数组

        System.out.println("输出所有数字字符."); //对数组进行遍历，找出所有数字字符。
        for (int i = 0; i < ch.length; i++) {
            if (ch[i] >= '0' && ch[i] <= '9') {
                System.out.print(ch[i]);
            }
        }
    }
}
